import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/index'
import login from '@/pages/login/index'
import index from '@/pages/index'
import cronTest from "@/test/cronTest"
import page404 from '@/components/404.vue'
import entRouter from "./ent-router"
import xtglRouter from "./auth"
import flowRouter from "./flow"
import creditRouter from "./credit-router"
import finRouter from "./fin-router"
import codegene from './codegene-router';

import potalRouter from './potal-router';
import logRouter from './log-router';

import messRouter from './mess-router';
import activityRouter from './activity-router';
import componentRouter from './component-router';

import arrangeRouter from './arrange-router';
Vue.use(Router)

export default new Router({
    routes: [{
        path: '/login',
        name: 'login',
        component: login,
    },
    {
        path: '/',
        name: 'Home',
        redirect: '/home',
        component: Home,
        children: [
            {
                path: '/error',
                name: 'error',
                component: page404,
                meta: {
                    title: 'page404',
                    icon: '',
                    noCache: true,
                    affix: true,
                },
            },
            {
                path: '/cronTest',
                name: 'cronTest',
                component: cronTest,
                meta: {
                    title: 'cronTest',
                    icon: '',
                    noCache: true,
                    affix: true,
                },
            },
            {
                path: '/home',
                name: 'index',
                component: index,
                meta: {
                    title: '首页',
                    icon: 'dashboard',
                    noCache: true,
                    affix: true,
                    all: true
                },
            },
            ...xtglRouter,
            ...flowRouter,
            ...entRouter,
            ...creditRouter,
            ...finRouter,
            ...potalRouter,
            ...logRouter,
            ...messRouter,
            ...codegene,
            ...activityRouter,
            ...componentRouter,
            ...arrangeRouter,
        ]
    },
    {
        path: '*',
        name: "404",
        redirect: '/error',
    },
    ]
})